package org.ch03.job.test03;

/**
 * @author XCH
 * @date 2025 - 03 - 25
 */
public class People<P extends ICall & Docile> {
    /**
     * 宠物 -
     */
    private P pet;

    public P getPet() {
        return pet;
    }

    public void setPet(P pet) {
        this.pet = pet;
    }

    /**
     * 逛街
     */
    public void shopping() {
        if (pet.isTame()) {
            System.out.println("逛街...");
            pet.call();
        } else {
            System.out.println("宠物不温顺，不能逛街...");
        }
    }

}